import java.util.Scanner;

/**
 * @author vivi
 * @description
 * @date 2024/5/25
 */
public class demo2 {
    public static int n = 0; // 数列最后一个数， 即最大值
    public static int m = 0; // 相加和为 m
    public static boolean[] choose = new boolean[11]; // 是否被选中
    public static int sum = 0; // 路径和
    public static void dfs(int x) {
        // 符合条件 输出
        if (sum == m) {
            for (int i = 1; i <= n; i++) {
                if (choose[i]) {
                    System.out.print(i + " ");
                }
            }
            System.out.println("");
            return;
        }
        // 不符合条件
        if (sum > m || x > n) return;

        // 选 x
        sum += x;
        choose[x] = true;
        dfs(x + 1);

        // 不选 x
        sum -= x;
        choose[x] = false;
        dfs(x + 1);
    }
    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        m = scanner.nextInt();

        dfs(1);
    }
}
